<template>
    <div id="dashboard-main">
        <el-row>
            <el-col :span="8" style="padding-right: 10px">
                <el-card class="box-card">
                    <div class="user">
                        <img :src="userInfo.avatar ? userInfo.avatar : require('@/assets/images/system/default-profile-picture.jpg')"
                            alt="" />
                        <div class="userInfo">
                            <p class="name">{{ userInfo.nickName }}</p>
                            <p class="access">部门：{{ userInfo.deptName }}</p>
                        </div>
                    </div>
                    <div class="loginInfo">
                        <p>
                            登录时间：<span>{{ formatLongToStr(userInfo.loginTime) }}</span>
                        </p>
                        <p>
                            登录地点：<span>{{ userInfo.loginIp }}</span>
                        </p>
                    </div>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>

<script>
import { formatLongToStr } from '@/common/utils/formatTime';
export default {
    data() {
        return {
            userInfo: JSON.parse(window.sessionStorage.getItem("userInfo"))
        };
    },
    mounted() {
    },
    methods: {
        formatLongToStr
    }
};
</script>

<style lang="less" scoped>
.user {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;

    img {
        margin-right: 40px;
        width: 150px;
        height: 150px;
        border-radius: 50%;
    }

    .userInfo {
        .name {
            font-size: 32px;
            margin-bottom: 10px;
        }

        .access {
            color: #999999;
        }
    }
}

.loginInfo {
    p {
        line-height: 28px;
        font-size: 14px;
        color: #999999;

        span {
            color: #666666;
            margin-left: 60px;
        }
    }
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
}

.sumData {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    .icon {
        width: 80px;
        height: 80px;
        font-size: 30px;
        color: #fff;
        text-align: center;
        line-height: 80px;
    }

    .detail {
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-left: 15px;

        .count {
            font-size: 30px;
            margin-bottom: 10px;
            line-height: 30px;
            height: 30px;
        }

        .desc {
            font-size: 14px;
            color: #999;
            text-align: center;
        }
    }

    .el-card {
        width: 32%;
        margin-bottom: 20px;
    }
}

.domain-container {
    height: 100%;
}

.graph {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;

    .el-card {
        width: 48%;
    }
}
</style>
